package cloud.daodao.storm.common.user.api;

import cloud.daodao.storm.common.constant.AppConstant;
import cloud.daodao.storm.common.model.PageData;
import cloud.daodao.storm.common.model.PageParam;
import cloud.daodao.storm.common.model.Request;
import cloud.daodao.storm.common.model.Response;
import cloud.daodao.storm.common.user.constant.UserConstant;
import cloud.daodao.storm.common.user.model.role.RoleData;
import cloud.daodao.storm.common.user.model.role.RoleSearch;
import cloud.daodao.storm.common.user.model.role.RoleSelect;
import cloud.daodao.storm.common.user.model.role.RoleUpsert;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * @author DaoDao
 */
@Tag(name = "RoleApi", description = "用户服务 角色")
@HttpExchange(url = AppConstant.API)
public interface RoleApi {

    @Operation(summary = "角色查询", description = "@DaoDao 传入角色 ID，查询一条角色数据")
    @PostExchange(url = UserConstant.ROLE_SELECT)
    Response<RoleData> roleSelect(@RequestBody @Valid Request<RoleSelect> request);

    @Operation(summary = "角色写入", description = "@DaoDao 传入角色新增或修改参数 ，写入角色数据")
    @PostExchange(url = UserConstant.ROLE_UPSERT)
    Response<RoleData> roleUpsert(@RequestBody @Valid Request<RoleUpsert> request);

    @Operation(summary = "角色搜索", description = "@DaoDao 传入角色查询参数，查询分页角色数据")
    @PostExchange(url = UserConstant.ROLE_SEARCH)
    Response<PageData<RoleData>> roleSearch(@RequestBody @Valid Request<PageParam<RoleSearch>> request);

}
